<?php
namespace app\api\controller\signreport;

use app\api\controller\Pub;
use app\common\model\signreport\Comment as commentModel;
use think\facade\Request;
use app\api\controller\Baseuser;

class Comment extends Baseuser
{

    // 写评论
    public function addComment()
    {
        $params =  Request::instance()->param();

        // 获取用户信息
        $params['u_id'] = $this->user_id;


        $result = $this->validate($params, 'Comment');
        if(true !== $result){
            return myerr($result);
        }
        // 将内容插入
        $res = (new commentModel())->addComment($params);
        if ($res) {
            return myok('添加成功');
        } else {
            return myerr($res);
        }
    }
}
